package com.xy.biz.auth.domain.converter;

import com.xy.biz.auth.domain.bo.UserPasswordBO;
import com.xy.biz.auth.domain.po.UserPasswordPO;
import com.xy.tool.util.BeanUtilsEx;

import java.util.Collection;
import java.util.List;

/**
 * 
 * 
 * @author zsp
 * @date 2020-6-11
 */
public class UserPasswordConverter {
	
	public static UserPasswordPO toPO(UserPasswordBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new UserPasswordPO(), true);
	}
	
	public static List<UserPasswordPO> toPO(Collection<UserPasswordBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new UserPasswordPO(), true);
	}
	
	public static UserPasswordBO fromPO(UserPasswordPO source) {
		return BeanUtilsEx.copyProperties(source, () -> new UserPasswordBO());
	}
	
	public static List<UserPasswordBO> fromPO(Collection<UserPasswordPO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new UserPasswordBO());
	}

}
